<head th:fragment=header(title)>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<meta name="keywords" content="汽车模型商城">
	<meta name="description" content="">
	<meta name="author" content="zhangy">
	<title th:text="${title}"></title>
    <link rel="stylesheet" href="/lib/weui.min.css">
    <link rel="stylesheet" href="/css/jquery-weui.css">
    <link rel="stylesheet" href="/css/style.css">
</head>

<div th:fragment="footer">
    <script src="/lib/jquery-2.1.4.js"></script>
    <script src="/lib/fastclick.js"></script>
    <script type="text/javascript" src="/js/jquery.lazyload.min.js"></script>
    <script>
        $(function() {
            FastClick.attach(document.body);
        });
    </script>
    <script src="/js/jquery-weui.js"></script>
    <script src="/js/swiper.js"></script>
    <script type="text/javascript" src="/js/jquery.Spinner.js"></script>
    <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

    <script type="text/javascript">
        // $('#foot-menu ul li').click(function(){
        //     $(this).addClass('active').siblings('li').removeClass('active');
        // })

        $(function() {
            var href = window.location.href;
            if(href.indexOf('/wx/classify') > -1){
                $("#classify-a").addClass('weui-bar__item--on').siblings('a').removeClass('weui-bar__item--on');
            }else if(href.indexOf('/wx/cart') > -1){
                $("#cart-a").addClass('weui-bar__item--on').siblings('a').removeClass('weui-bar__item--on');
            }else if(href.indexOf('/wx/orders') > -1){
                $("#orders-a").addClass('weui-bar__item--on').siblings('a').removeClass('weui-bar__item--on');
            }else{
                $("#home-a").addClass('weui-bar__item--on').siblings('a').removeClass('weui-bar__item--on');
            }
            // for (var i = window.location,
            //          n = $(".foot-menu a").filter(function() {
            //              return String(i.href).indexOf(this.href) > -1;
            //          }).addClass("weui-bar__item--on");;) {
            //     if (!n.is("a")) break;
            //     n = n.parents('#foot-menu').addClass("weui-bar__item--on")
            // }

        });
    </script>

</div>

<div th:fragment="foot-black">
    <div class="foot-black"></div>
    <div class="weui-tabbar wy-foot-menu" id="foot-menu">
        <a href="/wx/index" class="weui-tabbar__item weui-bar__item--on" id="index-a">
            <div class="weui-tabbar__icon foot-menu-home"></div>
            <p class="weui-tabbar__label">首页</p>
        </a>
        <a href="/wx/classify" class="weui-tabbar__item" id="classify-a">
            <div class="weui-tabbar__icon foot-menu-list"></div>
            <p class="weui-tabbar__label">分类</p>
        </a>
        <a href="/wx/cart" class="weui-tabbar__item" id="cart-a">
            <span th:if="${count > 0}" class="weui-badge" style="position: absolute;top: -.4em;right: 1em;" th:text="${count}">0</span>
            <div class="weui-tabbar__icon foot-menu-cart"></div>
            <p class="weui-tabbar__label">购物车</p>
        </a>
        <a href="/wx/orders" class="weui-tabbar__item" id="orders-a">
            <div class="weui-tabbar__icon foot-menu-member"></div>
            <p class="weui-tabbar__label">我的车库</p>
        </a>
    </div>
</div>

